<?php 
/**
 *   This file is part of GeoArticle (a Joomla plugin).
 *   Written by Ivar Bergman (www.ivarbergman.se)
 *   Copyright (c) 2010 Ivar Bergman. All rights reserved.
 *
 *   GeoArticle is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   GeoArticle is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with GeoArticle.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

?><html>
<head>
  <style>
  #submit_action{
    float:right;
    margin: 6px 2px 0 0;
  }
  
  .error {
    color: #f00;
    margin-bottom: 6px;
  }   
  </style>
  <script type="text/javascript" src="/includes/js/joomla.javascript.js"></script>
  <script type="text/javascript" src="/media/system/js/mootools.js"></script>
</head>
<body>
  <? if (count($this->errors)) : foreach ($this->errors as $error ) { ?>
  <div class="error"><?=$error?></div>
  <? } endif;?>
  <div>
    <form action="index.php" method="post" name="adminForm" id="adminForm">
      <fieldset class="adminform">
      <legend><?php echo JText::_( 'GPS Position' ); ?></legend>
      <table width="100%">
      <tr>
         <td>Longitude</td><td><input type="text" name="long" value="<?= $this->long ?>" /></td>
	 <td>Latitude</td><td><input type="text" name="lat" value="<?= $this->lat ?>" /></td>
	 </tr>
	 </table>
       </fieldset>
	 <br/>
      <fieldset class="adminform">
      <legend><?php echo JText::_( 'Contact information' ); ?></legend>
      <table width="100%">
	 <tr>	 
	 <td>Phone</td><td>   <input type="text" name="phone" value="<?= $this->phone ?>" /></td>
	 <td>Street  </td><td> <input type="text" name="street" value="<?= $this->street ?>" /></td>
	 </tr><tr>
	 <td>Postal  </td><td> <input type="text" name="postal" value="<?= $this->postal ?>" /></td>
	 <td>City  </td><td> <input type="text" name="city" value="<?= $this->city ?>" /></td>
	 </tr><tr>	 
	 <td>Email  </td><td> <input type="text" name="email" value="<?= $this->email ?>" /></td>
	 <td>Web  </td><td> <input type="text" name="web" value="<?= $this->web ?>" /></td>	 
	 </tr>
	 </table>

       </fieldset>
	 <br/>
      <fieldset class="adminform">
      <legend><?php echo JText::_( 'Activities and services' ); ?></legend>

        <ul style="width: 33%; float: left; list-style: none; padding: 0px;">
        <? 
	 $len = count($this->tags) / 3;
	 foreach ($this->tags as $tag ) 
	 {
	   echo sprintf(
			'<li><input type="checkbox" id="associations_%d" name="associations[%d]" value="1"%s><label for="associations_%d">%s</label></li>',
			$tag->id,
			$tag->id,
			(in_array((int) $tag->id,$this->associations)) ? ' checked' : '',
			$tag->id,
			$tag->title
			);
	   if (--$len < 0)
	     {
	       echo "</ul><ul  style=\"width: 33%; float: left;; list-style: none; ; padding: 0px;\">";
	       $len = count($this->tags) / 3;
	     }
	 }
        ?>
        </ul>
      </fieldset>
      <input type="hidden" name="option" value="com_geoarticle" />
      <input type="hidden" name="cid" value="<?= $this->cid; ?>" />
      <input type="hidden" name="task" value="save_tags" />
      <?php echo JHTML::_( 'form.token' ); ?>
      <div id="submit_action">
      <input type="button" value="Cancel" onclick="parent.SqueezeBox.window.close();">
      <input type="submit" value="OK">
      </div>
    </form>
  </div>
</body>
</html>